/**
 * 
 */
$(function(){
	$("#orderCode").html(sessionStorage.getItem("orderCode"));
	$("#total").html(sessionStorage.getItem("total"));
});

/**
 * 付款
 */
function pay(){
	
	var params = {};
	params.orderId = sessionStorage.getItem("orderCode");
	params.amount = sessionStorage.getItem("total");
	params.payType = $('#payTypeTable tr td input[name="payType"]:checked').val();
	
	$.ajax({
		type:"post",
		url:basePath + "/order/pay",
		data:JSON.stringify(params),
		async:true,
		dataType : 'json',
        contentType : 'application/json',
		success:function(data){
			if(data.status == "200"){
				$("#myModal2").modal("show");
				$("#surePay").on("click",function (){
					var password= $("#inputPwd").val();
					console.log(password);
					$.ajax({
						type:"post",
						url:basePath + "/order/passwordConfirm",
						data:{"password":password},
						async:true,
						success:function(data){
							if(data.status == "200"){
								$("#myModal3").modal("show");
								$("#sureHref").on("click",function (){
									window.location.href = "indexPage.html";
								});
							}else{
								
								$("#returnMsg").show();
							}
						}
					});
				});
			}
		}
	});
	
	
}


















